package com.boot2.core.model;

import com.boot2.core.IntBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * @ClassName: SysDictType
 * @Description: 【字典类型】 model
 * @author zhangweilin
 * @date 2020-6-17 12:18:17
 *
 */
@ApiModel("字典类型")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString(callSuper = true)
@Entity
@Table(name = "sys_dict_type",indexes = {@Index(columnList = "createTime"),@Index(columnList = "updateTime")})
//@SQLDelete(sql = "update sys_dict_type set is_deleted = id where id = ?")
//@Where(clause = "is_deleted = 0 or is_deleted is null ")
@DynamicInsert // 加上此注解，可以只添加有值的字段
@DynamicUpdate // 此注解，是指，会先查，然后跟参数对比，不一样的就更新，所以并不是有值更新，如果db中有值，参数里没值，那么db中的值会清空
public class SysDictType extends IntBaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	public SysDictType(Integer id) {
		this.id = id;
	}

	/**
	 *  @param isInit  是否初始化基础信息
	 */
	public SysDictType(boolean isInit) {
		super(isInit);
	}
	/**
	 * 字典名称
	 */
	@ApiModelProperty(value = "字典名称")
	private String dictName;
	/**
	 * 字典类型
	 */
	@ApiModelProperty(value = "字典类型")
	private String dictType;
	/**
	 * 状态（0正常 1停用）
	 */
	@ApiModelProperty(value = "状态（0正常 1停用）")
	private Boolean status;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注")
	private String remark;

}
